package cn.fly.blog.common.db.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.Instant;

@Accessors(chain = true)
@Getter
@Setter
public abstract class SuperEntity<T> extends StandardEntity
        implements CreateTimeLogable<T>, ModifyTimeLogable<T>,
        CreatorLogable<T>, ModifierLogable<T>, Serializable {

    /**
     * 时间传输统一使用时间戳，需要格式化时由前端进行格式化
     */
    @TableField(fill = FieldFill.INSERT)
    Instant createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    Instant modifyTime;
    @TableField(fill = FieldFill.INSERT)
    Long creatorId;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    Long modifierId;

}
